package com.shushan.invitecode.bean;

import com.android.net.bean.NetBaseBean;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: DayBean
 * @Desciption: 日期bean
 * @author: yichaohua
 * @date: 2018-09-15
 */
public class DayBean extends NetBaseBean {

    public String week;//星期几，0为星期天
    public int day;
    public int num;
    public int is_patch;//0是没补签 1是已经补签
    private List<String> inviteUserList = new ArrayList<String>();
    public int state;//0、今天之前 1、今天 2、今天之后

    @Override
    public void initByJson(JSONObject jsonObject) throws JSONException {
        week = jsonObject.optString("week","");
        day = jsonObject.optInt("day",0);
        num = jsonObject.optInt("num",0);
        is_patch = jsonObject.optInt("is_patch",0);
        state = jsonObject.optInt("state",2);

        JSONArray jsonArray = jsonObject.optJSONArray("invite_user");
        if(jsonArray != null){
            for (int i = 0;i < jsonArray.length();i++){
                String str = jsonArray.optString(i);
                inviteUserList.add(str);
            }

        }
    }

    public List<String> getInviteUserList() {
        return inviteUserList;
    }

    public void setInviteUserList(List<String> inviteUserList) {
        this.inviteUserList = inviteUserList;
    }
}
